package com.panda.mall.common.result;

import lombok.Data;

/**
 * author: tcy
 * createDate: 2022/10/9
 * description:请求异常
 */
@Data
public class ServiceException extends RuntimeException {

    /**
     * 状态编码
     */
    private int code;

    /**
     * 响应消息
     */
    private String message;

    public ServiceException(int code, String message) {
        super(message);
        this.code = code;
        this.message = message;
    }

    public ServiceException(String message){
        this(ResultEnums.Fail.getCode(),message);
    }

}
